<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>体育与健康课程管理系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/public/css/main.css"/>
    <link href="${pageContext.request.contextPath}/public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath}/public/js/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/public/js/jquery-3.2.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/public/js/layer/layer.js"></script>
    <script src="${pageContext.request.contextPath}/public/laydate/laydate.dev.js"></script>
    <script src="${pageContext.request.contextPath}/public/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<p style="margin-top:15px;margin-left:40px; font-size:16px; border-left:3px #006dcc solid; padding-left:5px">打印体育技能考试二安排</p>
<div class="container clearfix" style="width:100%">
    <div class="main-wrap">
        <div class="search-wrap">
            <div class="search-content">
                <table class="search-tab">
                    <form id="classform" action="${pageContext.request.contextPath}/skilltest2/selectshowprint.action" method="post">
                        <th width="150px" style="font-size:16px">选择时间:</th>
                        <td>
                            <input  id="test" style="height:32px" required="required"  onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name='startTime' class="laydate-icon common-text" type='text'  placeholder="起始日期">
                        </td>
                        <td>
                            <input style="height:32px" required="required" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name='endTime' class="laydate-icon common-text" type='text'  placeholder="截止日期">
                        </td>
                        <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        <a style="float: right" class="btn btn-primary" onclick="printme()">打印</a>

                    </form>

                    <form action="${pageContext.request.contextPath}/skilltest2/export.action" method="post">
                        <th width="150px" style="font-size:16px">选择时间:</th>
                        <td>
                            <input style="height:32px" required="required"  onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name='startTime' class="laydate-icon common-text" type='text'  placeholder="起始日期">
                        </td>
                        <td>
                            <input style="height:32px" required="required" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name='endTime' class="laydate-icon common-text" type='text'  placeholder="截止日期">
                        </td>
                        <td><input class="btn btn-primary btn2" name="sub" value="导出excel" type="submit"></td>
                    </form>
                </table>
            </div>
        </div>
        <div class="result-wrap" id="result" >
            <div class="result-content" id="app" style="font-size: 12px">
                <table class="result-tab" width="100%" >
                    <tr>
                        <th>序号</th>
                        <th>考试时间</th>
                        <th>体育技能考试</th>
                        <th>考试地点</th>
                        <th>考试人数</th>
                        <th>主监考老师</th>
                        <th>副监考老师</th>
                    </tr>
                    <c:forEach items="${data}" var="v" varStatus="status">
                        <tr >
                            <td>${status.index+1}</td>
                            <td><fmt:formatDate value="${v.peExaminationStarTime}" pattern="yyyy-MM-dd"/>　<fmt:formatDate value="${v.peExaminationStarTime}" pattern="HH:mm"/>-<fmt:formatDate value="${v.peExaminationEndTime}" pattern="HH:mm"/></td>
                            <%--<td><fmt:formatDate value="${v.peExaminationStarTime}" pattern="yyyy-MM-dd/HH:mm:ss"/> </td>--%>
                            <%--<td><fmt:formatDate value="${v.peExaminationEndTime}" pattern="yyyy-MM-dd/HH:mm:ss"/></td>--%>
                            <td>${v.peExaminationName}</td>
                            <td>${v.peExaminationPlace}</td>
                            <td>${v.peExaminationUpperLimit}</td>
                            <td>${v.nameExp6}</td>
                            <td>${v.nameExp7}</td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function printme()
    {
        var oldstr = document.body.innerHTML;
        var headstr = "<html><head><title>体育技能考试安排</title></head><style>.print{font-size: 12px;}</style><body>";  //打印头部
        var title="<center><h3>体育技能二</h3></center>";
        var footstr = "</body><ml>";  //打印尾部
        var printData = document.getElementById("result").innerHTML; //获得 p 里的所有 html 数据
        document.body.innerHTML = headstr+title+printData+footstr;
        window.print();
        document.body.innerHTML = oldstr;   //保持原页面格式
    }
</script>
</html>
